package cn.shenlong.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration("adminConstants")
@PropertySource("classpath:global.properties")
public class Constants {
	
   public final static String APPLICATION_URL ="/"+ Thread.currentThread()
			.getContextClassLoader().getResource("").getPath().substring(1)
			.replaceAll("WEB-INF/classes/", "");
  
/*	public final static String APPLICATION_URL = "C:\\Users\\zhengjinfeng\\git\\laluna\\luna\\WebContent\\";
 */
 
	/**
	 * 导航条个数  
	 */
	public static String NAVIGATION_NUM;

	/**
	 * 版位个数
	 */
	public static String LOCATION_NUM;

	/**
	 * 后台登录的地址
	 */
	public static String ADMIN_LOGIN_URL;

	// 上传的路径汇总
	public static final String CONTENT_IMG_URI = "u/server/contentimg";

	public static final String CHANNEL_IMG_URI = "u/server/channelimg";

	public static final String LINK_IMG_URI = "u/server/linkimg";

	public static final String UEDITOR_IMG_URI = "u/ueditorimg";
	
	public static final String COMPANY_IMG_URI = "u/server/companyimg";
	
	public static final String ICON_IMG_URI = "u/server/iconimg";
	
	public static final String DISCOUNT_IMG_URI = "u/server/discountimg";

	@Autowired(required = true)
	public void setNavigationNum(@Value("${global.navigationNum:8}") String num) {
		Constants.NAVIGATION_NUM = num;
	}

	@Autowired(required = true)
	public void setLocationNum(@Value("${global.locationNum:8}") String unm) {
		Constants.LOCATION_NUM = unm;
	}

	@Autowired(required = true)
	public void setAdminLoginUrl(
			@Value("${global.adminLoginUrl:http://127.0.0.1/login.html}") String url) {
		Constants.ADMIN_LOGIN_URL = url;
	}
}


 

